package com.tr.rentcar.controller.houtai.admin;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr.rentcar.model.bean.Adminrole;
import com.tr.rentcar.model.dao.AdminroleDao;


@WebServlet("/houtaiadminrole")
public class AdminroleControllor extends HttpServlet {
	AdminroleDao adminroledao=new AdminroleDao();
	Adminrole adminrole=new Adminrole();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	try {
		List<Adminrole> adminrole=adminroledao.findall();
		req.getSession().setAttribute("adminrole", adminrole);
		req.getRequestDispatcher("/WEB-INF/jsp/houtai_adminrole.jsp").forward(req, resp);
	} catch (SQLException e) {
		e.printStackTrace();
	}
}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req, resp);
	}
}
